package com.funtest

import spock.lang.Specification

class T extends Specification{


    def "result should be true"(){
        given:
        boolean a = false;
        boolean b = true;

        when:
        boolean result = a || b;

        then:
        result == true;
    }
}
class EmptyStackSpec extends Specification {
    def stack = new Stack()

    def "size"() {
        expect: stack.size() == 0
    }

    def "pop"() {
        when: stack.pop()
        then: thrown(EmptyStackException)
    }

    def "peek"() {
        when: stack.peek()
        then: thrown(EmptyStackException)
    }

    def "push"() {
        when:
        stack.push("elem")

        then:
        stack.size() == old(stack.size()) + 1
        stack.peek() == "elem"
    }
}